package com.ease.framework {
	import com.ease.util.ObjectFilter;

	/**
	 * This interface defines an object directory that can be looked up for objects that
	 * satisfy a certain filter or specification. This filter is based on the properties
	 * and/or meta-properties (e.g., class info) of those objects.
	 *
	 * @see ObjectSpec
	 * @see InjectionManager
	 */
	public interface IObjectDirectory	{
		/**
		 * Looks up existing or creates new objects that fit the given spec.
		 *
		 * @param spec
		 *    Specifies the objects to be returned.
		 *
		 * @param callback
		 *    The callback function is supposed to be of the form:
		 *    <p><code>function foo( objects:Array, error:Error ):void { ... }</code>
		 *    <p>where error is optional.
		 *
		 * @param moduleReference
		 *    A module (or app domain) reference that can be used to create new objects, if
		 *    necessary, in order to satisfy the object request made through this method. This
		 *    can be any object that is defined in the module of interest (i.e., the module
		 *    that links all the types whose instances are being requested here).
		 *
		 * @param currentObjectset
		 *    The current object set that is to be replaced (partially or fully) by the objects
		 *    returned by this method.
		 */
		function getObjects( spec:ObjectFilter, callback:Function,
							 moduleReference:* = null,
							 currentObjectSet:Array/*?*/ = null ):void;

		/**
		 * Evaluates the meta-filters in the given spec recognized by this directory, for the
		 * given object (to see if the object satisfies the meta-property criteria).
		 */
		function evaluateMetaFilter( spec:ObjectFilter, object:* ):Boolean;
	}
}